package cn.pn.project.client.user;


import cn.pn.project.pojo.base.Coupon;
import cn.pn.project.pojo.user.Usercoupon;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;


import java.util.List;

@FeignClient(name="pn-user-provider")
@RequestMapping("userCoupon")
public interface UserCouponFeign {
    /**
     *  根据状态和用户id查询优惠券id
     * @param status   状态
     * @return  优惠券id集合
     */
    @PostMapping("findByStatus")
    List<Usercoupon> findByStatus(@RequestParam("status") Integer status,@RequestParam("userId") Integer userId)throws Exception;

    /**
     *
     * @param usercoupon
     * @return
     */
    @PostMapping("AddUsercoupon")
    Integer AddUsercoupon(@RequestBody Usercoupon usercoupon);

    /**
     * 免费领取添加用户优惠券
     * @param usercoupon
     * @return
     */
    @RequestMapping("AddUsercouponmf")
    Integer AddUsercouponmf(@RequestBody Usercoupon usercoupon) throws Exception;

    /**
     * 根据id删除优惠券
     * @param userCouponId
     * @return
     * @throws Exception
     */
    @RequestMapping("DelUserCoupon")
    Integer DelUserCoupon(Integer userCouponId) throws  Exception;
}
